package com.ikingtech.framework.sdk.schedule.api;

import com.ikingtech.framework.sdk.core.response.R;
import com.ikingtech.framework.sdk.schedule.model.ScheduleDTO;
import com.ikingtech.framework.sdk.schedule.model.ScheduleQueryParamDTO;
import com.ikingtech.framework.sdk.web.annotation.PostRequest;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @author tie yan
 */
public interface ScheduleApi {


    @PostRequest(order = 1, value = "/add", summary = "新增", description = "新增")
    R<String> add(@Parameter(name = "schedule", description = "新增参数") @RequestBody ScheduleDTO schedule);

    @PostRequest(order = 2, value = "/delete", summary = "删除", description = "删除")
    R<Object> delete(@Parameter(name = "id", description = "删除参数") @RequestBody String id);

    @PostRequest(order = 3, value = "/update", summary = "更新", description = "更新")
    R<Boolean> update(@Parameter(name = "schedule", description = "更新参数") @RequestBody ScheduleDTO schedule);

    @PostRequest(order = 4, value = "/detail", summary = "详情", description = "详情")
    R<ScheduleDTO> detail(@Parameter(name = "id", description = "主键编号") @RequestBody String id);

    @PostRequest(order = 5, value = "/list/page", summary = "分页查询", description = "分页查询")
    R<List<ScheduleDTO>> page(@Parameter(name = "queryParam", description = "查询参数")
                              @RequestBody ScheduleQueryParamDTO queryParam);

    @PostRequest(order = 6, value = "/list/all", summary = "全量查询", description = "全量查询")
    R<List<ScheduleDTO>> all();

    @PostRequest(order = 6, value = "/count/date", summary = "按日期查询日程数量", description = "按日期查询日程数量")
    R<Map<String, Integer>> countByDate(@Parameter(name = "queryParam", description = "查询参数")
                                        @RequestBody ScheduleQueryParamDTO queryParam);
}
